function Map(input, output) {
  /* input should be a single line */
  var re = /^\<([^>]*)\> \<[^>]*\> \<([^>]*)\>/; 
  var parts = input.value.match(re); 

  var source = parts[1];
  var dest   = parts[2];

  output.emit(dest, source);
}


function Reduce(input, output) {
  var page = input.key;
  var links = [];
  for(var i in input.values) {
//    links.push(input.values[i]);
    var links = input.values[i];
    output.emit(input.key, links.toString());
  }
}
